<link rel="stylesheet" type="text/css" href="/static/css/pc/index.css" />
<link rel="stylesheet" href="/static/css/pc/common.less" />
<link rel="stylesheet/less" type="text/css" href="/static/css/pc/index.less">
<style type="text/css">
  ul {
    list-style: none!important;
  }
  p{
    margin: 0 0 1px!important;
  }
  .buy-btn{
      font-size: 14px;
      width: 118px;
      height: 34px;
      line-height: 34px;
      border-radius: 18px;
      background: #488DFB;
      color: #fff;
      transition: all 0.5s;
      display: block;
      margin: 0 auto;
      border: 1px solid #488DFB;
      text-align: center;
  }
</style>
<div class="content" id="content" val="1">
  <div class="container">
    <div>
      <!-- 限时购 -->
      <div class="flash-sale-container">
        <div class="banner fl">
          <p class="title"><i class="iconfont iconxianshigouicon"></i>限时购</p>
          <div class="time-container">
            <p class="time">22点场</p>
            <div class="hr"></div>
            <p class="desc">距离结束还剩</p>
            <div class="cont-down">
              <span class="cd hh">00</span>
              <span class="colon">:</span>
              <span class="cd mm">00</span>
              <span class="colon">:</span>
              <span class="cd ss">00</span>
            </div>
            <a class="more-btn">查看全部<i class="iconfont iconjiantouhui"></i></a>
          </div>
        </div>
        <div class="goods-block">
          <div class="date-picker">
            <ul class="date-list" id="date-list">
              <li class="date">
                <p class="title">周一</p>
                <p class="desc">抢购中</p>
              </li>
              <li class="date active">
                <p class="title">周二</p>
                <p class="desc">抢购中</p>
              </li>
              <li class="date">
                <p class="title">周三</p>
                <p class="desc">抢购中</p>
              </li>
              <li class="date">
                <p class="title">周四</p>
                <p class="desc">抢购中</p>
              </li>
              <li class="date">
                <p class="title">周五</p>
                <p class="desc">抢购中</p>
              </li>
              <li class="date">
                <p class="title">周六</p>
                <p class="desc">抢购中</p>
              </li>
              <li class="date">
                <p class="title">周日</p>
                <p class="desc">抢购中</p>
              </li>
            </ul>
            <a class="more-btn">更多抢购<i class="iconfont iconjiantouhui"></i></a>
          </div>
          <ul class="goods-list clearfix">
            <li class="goods-container">
              <div style="margin: 12px 0 2px 0;">
                <div style="z-index: 999;position: relative;top: 155px;height: 0;">
                  <a class="buy-btn" val="1" name="checkProduct">点击选择1</a>
                </div>
                <img src="/static/images/background.png" style="width: 232.5px;height: 340px">
              </div>
            </li>
            <li class="goods-container">
              <div style="margin: 12px 0 2px 0;">
                <div style="z-index: 999;position: relative;top: 155px;height: 0;">
                  <a class="buy-btn" val="2" name="checkProduct">点击选择2</a>
                </div>
                <img src="/static/images/background.png" style="width: 232.5px;height: 340px">
              </div>
            </li>
            <li class="goods-container">
              <div style="margin: 12px 0 2px 0;">
                <div style="z-index: 999;position: relative;top: 155px;height: 0;">
                  <a class="buy-btn" val="3" name="checkProduct">点击选择3</a>
                </div>
                <img src="/static/images/background.png" style="width: 232.5px;height: 340px">
              </div>
            </li>
            <li class="goods-container">
              <!--<div class="state-box">
                <div class="progress-box">
                  <div class="progress" style="width: 50%"></div>
                </div><span class="stock">还剩199件</span>
              </div>
              <img class="goods-img img-scale" src="/static/images/pc/11.png">
              <div class="goods-info">
                <p class="title">抽屉式五彩储物柜</p>
                <p class="desc">食品级材质，稳固承重</p>
                <p class="price-container"><span class="price">限时价：￥138.2</span><span class="old-price">159元起</span>
                </p>
              </div>
              <a class="buy-btn" href="/">立即抢购</a>-->
              <div style="margin: 12px 0 2px 0;">
                <div style="z-index: 999;position: relative;top: 155px;height: 0;">
                  <a class="buy-btn" val="4" name="checkProduct">点击选择4</a>
                </div>
                <img src="/static/images/background.png" style="width: 232.5px;height: 340px">
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
    <div class="sale-banner">
      <a href="#">
        <img src="/static/images/pc/img_06.png">
      </a>
    </div>
  </div>
</div>
<!-- 编辑 Modal
<div class="modal hide fade" id="checkProductInfoByName" style="width: 700px;" tabindex="-1" role="dialog">
  <div class="modal-header">
    <button class="close" type="button" data-dismiss="modal">×</button>
    <h3 id="addRoleModalLabel">选择商品信息</h3>
  </div>
  <div class="modal-body">
    <form id="dataForm" class="definewidth m20" enctype="multipart/form-data">
      <input type="hidden" id="id" />
      <input type="hidden" id="config_id" />
      <table class="table table-bordered table-hover definewidth m10">
        <tr>
          <td style="width: 25%;" class="tableleft">商品名称</td>
          <td style="width: 63%;">
            <input type="text" id="productName" style="width: 300px;" class="required-control" />
            <span style="color:red;">*</span>
          </td>
          <td>
            <a href="javascript:void(0);" id="queryProductInfo" class="btn btn-primary">查询</a>
          </td>
        </tr>
      </table>
    </form>
    <table id="taskList_table" class="table table-bordered table-hover definewidth">

    </table>
  </div>
  <div class="modal-footer">
    <a href="javascript:$('.required-control').each(function(){$(this).css('border','1px solid #ccc');$(this).attr('placeholder','');});$('#checkProductInfoByName').modal('hide');$('#dataForm')[0].reset();"
       class="btn">关闭</a>
    <a href="javascript:void(0);" id="doSaveProduct" class="btn btn-primary">保存</a>
  </div>
</div> -->
<!-- <script type="text/javascript" src="/static/js/lib/pcIndex.js"></script> -->
<!-- <script type="text/javascript">
    _function.queryUserInfo({t:'indexProductConfig',config_id:$('#content').attr('val')},function (data) {
        if(null!=data && null!=data.products_id){
           var produsts=JSON.parse(data.products_id);
           if(null!=produsts && produsts.length>0){
               $.each(produsts,function (index,val) {
                   $(".buy-btn[val="+val.id+"]").text('点击修改'+val.id).css('background-color','red').css('border','1px solid red');
               });
           }
        }
    })
    var columns = [{
        field: 'id',
        title: '选择',
        width: '50',
        align: 'center',
        formatter: function(value, row, index) {
            return '<input type="checkbox" name="checkProductId" value="' + value + '"/>';
        }
    },{
        field: 'name',
        title: '商品名称',
        align: 'center'
    },{
        field: 'shopname',
        title: '所属店铺',
        align: 'center'
    },
    {
        field: 'price',
        title: '所属价格',
        align: 'center'
    },
    {
        field: 'status',
        title: '状态',
        align: 'center',
        formatter:function(value,row,index){
            if(value==0){
                return '上架'
            }else{
                return '下架';
            }
        }
    }];
    // 渲染table
    initTablePage({t:'product',sqlCount:'queryListPageCount'},{column:columns});
    //点击选择
    $("a[name='checkProduct']").click(function(){
        $("#id").val($(this).attr('val'));
        $("#checkProductInfoByName").modal("show");
    });
    //查询
    $("#queryProductInfo").click(function () {
        initTablePage({t:'product',sqlCount:'queryListPageCount',name:$("#productName").val()},{column:columns});
    });
    //保存
    $("#doSaveProduct").click(function () {
        if($('input[name="checkProductId"]:checked').length>1){
          alert_msg("只能选择一条");
          return false;
        }
        _function.queryUserInfo({t:'indexProductConfig',config_id:$('#content').attr('val')},function (data) {
            if(null!=data){
                if(null!=data && null!=data.products_id){
                    var produstArray=JSON.parse(data.products_id);
                    $('input[name="checkProductId"]:checked').each(function(index, val) {
                        var requData=$(this).val();
                        var flg=true;
                        $.each(produstArray,function (index,val) {
                            if(val.id==$('#id').val()){
                                flg=false;
                                val.product_id=requData;
                                return false;
                            }else{
                                flg=true;
                                return true;
                            }
                        })
                        if(flg){
                            var produsts={};
                            produsts.id=$('#id').val();
                            produsts.product_id=$(this).val();
                            produstArray.push(produsts);
                        }
                    });
                    _function.editUserInfo({t:'indexProductConfig',id:data.id,config_id:$('#content').attr('val'),products_id:JSON.stringify(produstArray)},function (data) {
                        $(".buy-btn[val="+$('#id').val()+"]").text('点击修改'+$('#id').val()).css('background-color','red').css('border','1px solid red');
                        $("#checkProductInfoByName").modal("hide");
                    })
                }
            }else{
                var array=[];
                $('input[name="checkProductId"]:checked').each(function(index, val) {
                    var produsts={};
                    produsts.id=$('#id').val();
                    produsts.product_id=$(this).val();
                    array.push(produsts);
                });
                _function.editUserInfo({t:'indexProductConfig',config_id:$('#content').attr('val'),products_id:JSON.stringify(array)},function (data) {
                    $(".buy-btn[val="+$('#id').val()+"]").text('点击修改'+$('#id').val()).css('background-color','red').css('border','1px solid red');
                    $("#checkProductInfoByName").modal("hide");
                })
            }
        });
    });
</script> -->
